<%- include ../common/header %>
<link rel="stylesheet" type="text/css" href="/css/find/findContent.css"/>
<link rel="stylesheet" type="text/css" href="/css/common/reset.css"/>
<link rel="stylesheet" type="text/css" href="/css/common/dialog.css"/>
<!--视频播放部分-->
<header>
    <div class="header" id="back"></div>
</header>
<div id="Banner" style="height:100%;width:100%; margin-top:40px;">
    <video id="videoPlayer_0" data-setup="{}" poster="" autoplay controls autobuffer>
        <source id="video_mp4" src="" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
        <source id="video_Webm" src="" type='video/webm; codecs="vp8, vorbis"'>
        抱歉，您的浏览器不支持video标签
    </video>
</div>
<div id="kqycVidioTip" style="display: none;">
    考前预测课程内容：<br>
    1.历年真题讲解，10个课时；<br>
    <span style="color: mediumblue;">2.试题+知识点预测，考前两周开课，18个课时。</span>
</div>
<%- include ../common/footer %>
<script src="/js/common/ajax.js" type="text/javascript"></script>
<script src="/js/common/dialog.js" type="text/javascript"></script>
<script src="/js/common/yingSoftPrg.js" type="text/javascript"></script>
<script src="/js/common/yingSoftCookie.js" type="text/javascript"></script>
<script type="text/javascript">
    if (!!document.all) {
        window.attachEvent('onresize', _winResize);
    } else {
        window.addEventListener('resize', _winResize, false);
    }
    function _winResize() {
        document.getElementById('Banner').style.height = document.getElementById('videoPlayer_0').clientHeight + 'px';
    }
    var cptName = G_Prg.getQueryString('cptName', true);
    var purviewFlag = G_Prg.getQueryString('purviewFlag', true);
    var fromUrl = G_Prg.getQueryString('fromUrl');
    var type = G_Prg.getQueryString('type');
    var courseType = G_Prg.getQueryString('courseType');
    var videoName = G_Prg.getQueryString('videoName');
    var videoName2 = G_Cookie.getVideoName();
    var appEName = G_Cookie.getAppEName();
    var myVideo = G_Prg.$('videoPlayer_0');
    var addressLists = new Object();  //存储视频播放地址的伪哈希表
    if (appEName.indexOf('JC_EJJZS_') >= 0) {
        /*
         JC_EJJZS_GLGC JC_EJJZS_JDGCGL JC_EJJZS_SZGRGCGL JC_EJJZS_JZGCGL JC_EJJZS_JSSGGL JC_EJJZS_JSGCFG
         /longben/erjijianzaoshi/JC_EJJZS_GLGC/jichuyuxi/
         */
        var url = 'http://up.ksbao.com/longben/erjijianzaoshi/' + appEName + '/' + courseType + '/';
        webm = url + videoName2 + '.webm';
        mp4 = url + videoName2 + '.MP4';
        G_Prg.$('back').innerHTML = cptName;
        console.log(cptName)
    } else if (appEName.indexOf('JC_YJJZS_') >= 0) { //一建的
        var url = 'http://yijianshipin.b0.upaiyun.com/' + appEName + '/';
        webm = url + videoName2 + '.webm';
        mp4 = url + videoName2 + '.MP4';
        G_Prg.$('back').innerHTML = cptName;
    } else {
        var videoUrl = 'http://up.ksbao.com/jinyingjie/';
        switch (appEName) {
            case 'ZY_HS':   //执业护士
                addressLists['jpkc_address'] = videoUrl + 'jpkc/zhiyehushi/';   //精品课程
                addressLists['yhyc_address'] = videoUrl + 'yhyc/';  //易混易错
//                addressLists['kqyc_address'] = videoUrl + 'jpkc/linchuangzhiyeyishi_jpkc/'; //考前预测
                addressLists['kqyc_address'] = videoUrl + 'kqyc/ZY_HS/2016kaoqianyuce/';  //考前预测
                addressLists['kqyc_lnzt_address'] = videoUrl + '/hushizhiye/kaoqianyuce/linianzhentijiangjie/'; //考前预测历年真题讲解
                break;
            case 'ZY_LC':   //临床执业医师
                addressLists['jpkc_address'] = videoUrl + 'jpkc/linchuangzhiyeyishi_jpkc/';   //精品课程
                addressLists['yhyc_address'] = videoUrl + 'yhyc/';  //易混易错
                addressLists['kqyc_address'] = videoUrl + 'kqyc/';  //考前预测
                addressLists['kqyc_lnzt_address'] = videoUrl + 'linchuangzhiyeyishi/kaoqianyuce/linianzhentijiangjie/'; //考前预测历年真题讲解
                break;
            case 'ZY_LC_ZL':    //临床执业助理医师
                addressLists['jpkc_address'] = videoUrl + 'jpkc/linchuangzhiyeyishi_jpkc/';   //精品课程
                addressLists['yhyc_address'] = videoUrl + 'yhyc/';  //易混易错
                addressLists['kqyc_address'] = videoUrl + 'kqyc/';  //考前预测
                break;
            case 'ZY_LCSJJN':   //临床执业医师实践技能
                addressLists['sjjn_address'] = videoUrl + 'sjjn/2016linchuangzhiyeyishi/';    //实践技能
                break;
            case 'ZY_LCZLSJJN': //临床执业助理医师实践技能
                addressLists['sjjn_address'] = videoUrl + 'sjjn/2016linchuangzhiyeyishi/';    //实践技能
                break;
            case 'ZY_ZYI':  //中医执业医师
                addressLists['jpkc_address'] = videoUrl + 'jpkc/zhongyizhiyeyishi/';    //精品课程
                addressLists['yhyc_address'] = videoUrl + 'yhyc/zhongyizhiyeyishi/';  //易混易错
                addressLists['kqyc_address'] = videoUrl + 'kqyc/';  //考前预测
                break;
            case 'ZY_ZYI_ZL':   //中医执业助理医师
                addressLists['jpkc_address'] = videoUrl + 'jpkc/zhongyizhiyeyishi/';    //精品课程
                addressLists['yhyc_address'] = videoUrl + 'yhyc/zhongyizhiyeyishi/';  //易混易错
                addressLists['kqyc_address'] = videoUrl + 'kqyc/';  //考前预测
                break;
            case 'ZY_ZYSJJN': //中医执业医师实践技能
                addressLists['sjjn_address'] = videoUrl + 'sjjn/2016zhongyizhiyeyishi/';    //实践技能
                break;
            case 'ZY_ZYZLSJJN': ////中医执业助理医师实践技能
                addressLists['sjjn_address'] = videoUrl + 'sjjn/2016zhongyizhiyeyishi/';    //实践技能
                break;
            case 'ZY_ZXY':  //中西医执业医师
                addressLists['jpkc_address'] = videoUrl + 'jpkc/zhongxiyijiehezhiyeyishi/';   //精品课程
                addressLists['yhyc_address'] = videoUrl + 'yhyc/zhongxiyijiehezhiyeyishi/'; //易混易错
                addressLists['kqyc_address'] = videoUrl + 'kqyc/';  //考前预测
                break;
            case 'ZY_ZXY_ZL':   //中西医执业助理医师
                addressLists['jpkc_address'] = videoUrl + 'jpkc/zhongxiyijiehezhiyeyishi/';   //精品课程
                addressLists['yhyc_address'] = videoUrl + 'yhyc/zhongxiyijiehezhiyeyishi/'; //易混易错
                addressLists['kqyc_address'] = videoUrl + 'kqyc/';  //考前预测
                break;
            case 'ZY_ZXYSJJN':   //中西医执业医师实践技能
                addressLists['sjjn_address'] = videoUrl + 'sjjn/2016zhongxiyijiehezhiyeyishi/';   //实践技能
                break;
            case 'ZY_ZXYZLSJJN': //中西医执业助理医师实践技能
                addressLists['sjjn_address'] = videoUrl + 'sjjn/2016zhongxiyijiehezhiyeyishi/';   //实践技能
                break;
            case 'ZY_ZYAO': //执业药师（中药）
                addressLists['kqyc_address'] = videoUrl + 'kqyc/';  //考前预测
                break;
            case 'ZY_XY': //执业药师（西药）
                addressLists['kqyc_address'] = videoUrl + 'kqyc/';  //考前预测
                break;
            case 'ZY_KQ':   //口腔执业医师
                addressLists['jpkc_address'] = videoUrl + 'jpkc/ZY_KQ/';    //精品课程
                break;
            case 'ZY_KQ_ZL':   //口腔执业助理医师
                addressLists['jpkc_address'] = videoUrl + 'jpkc/ZY_KQ_ZL/';   //精品课程
                addressLists['kqyc_lnzt_address'] = videoUrl + 'kqyc/ZY_KQ_ZL/lnzt/'; //考前预测历年真题讲解
                break;
        }

        var webm = '';
        var mp4 = '';
        if (type === 'easyError') {
            G_Prg.$('back').innerHTML = '易混易错';
            webm = addressLists['yhyc_address'] + videoName + '.webm';
            mp4 = addressLists['yhyc_address'] + videoName + '.MP4';
        } else if (type === 'kqyc') {

            if (appEName === 'ZY_LC' || appEName === 'ZY_LC_ZL' || appEName === 'ZY_ZYI' || appEName === 'ZY_ZYI_ZL' || appEName === 'ZY_ZXY' || appEName === 'ZY_ZXY_ZL' || appEName === 'ZY_ZYAO' || appEName === 'ZY_XY' || appEName === 'ZY_HS') {
                if (videoName2) {
                    G_Prg.$('back').innerHTML = cptName;
                    webm = addressLists['kqyc_address'] + videoName2 + '.webm';
                    mp4 = addressLists['kqyc_address'] + videoName2 + '.MP4';
                } else {
                    G_Prg.$('kqycVidioTip').removeAttribute('style');//陶云：如果是试听的视频，则显示课程内容提示。
                    G_Prg.$('back').innerHTML = '考前预测';
                    webm = videoUrl + 'jpkc/linchuangzhiyeyishi_jpkc/kaoqianyuce.webm';
                    mp4 = videoUrl + 'jpkc/linchuangzhiyeyishi_jpkc/kaoqianyuce.MP4';
                }
            } else {
                G_Prg.$('kqycVidioTip').removeAttribute('style');//陶云：如果是试听的视频，则显示课程内容提示。
                G_Prg.$('back').innerHTML = '考前预测';
                webm = addressLists['kqyc_address'] + 'kaoqianyuce.webm';
                mp4 = addressLists['kqyc_address'] + 'kaoqianyuce.MP4';
            }
        } else if (type === 'jpkc') {
            G_Prg.$('back').innerHTML = cptName;
            webm = addressLists['jpkc_address'] + videoName2 + '.webm';
            mp4 = addressLists['jpkc_address'] + videoName2 + '.MP4';
        } else if (type === 'sjjn') {
            G_Prg.$('back').innerHTML = cptName;
            webm = addressLists['sjjn_address'] + videoName2 + '.webm';
            mp4 = addressLists['sjjn_address'] + videoName2 + '.MP4';
        } else if (type === 'kqyclnzt') {//执业护士考前预测历年真题讲解。
            G_Prg.$('back').innerHTML = cptName;
            webm = addressLists['kqyc_lnzt_address'] + videoName2 + '.webm';
            mp4 = addressLists['kqyc_lnzt_address'] + videoName2 + '.MP4';
        }

    }//end if 判断是否是建筑系列的

    G_Prg.$('video_mp4').src = mp4;
    G_Prg.$('video_Webm').src = webm;
    myVideo.load();
    myVideo.addEventListener('canplay', function () {
        setVideoState();
    });
    /********************************************************************************
     功能：设置播放器的播放功能，方便安卓封壳调用实现自动播放
     输入参数: 无
     返回值：无
     ********************************************************************************/
    function setVideoState() {
        G_Prg.$('videoPlayer_0').autoplay = 'autoplay';
        G_Prg.$('videoPlayer_0').play();
    }
    G_Prg.$('back').onclick = function () {
        myVideo.pause();  //退出页面暂停播放视频
        var url = fromUrl + '?fromUrl=video_play&purviewFlag=' + purviewFlag;
        var curPage = G_Prg.getQueryString('page');
        var allTestID = G_Prg.getQueryString('allTestID');
        if (fromUrl === 'doExam-index') {
            url += '&type=easyError' + '&allTestID=' + videoName + '&page=' + curPage;
        } else if (type === 'sjjn' || type === 'jpkc' || fromUrl === 'videoList' || type === 'kqyclnzt' || type === 'kqyc') {
            url += '&type=' + type;
        }
        window.location.href = url;
    };
</script>
